'use strict';

define(['jquery'],function($){
	var add_option = function($obj,options){
		for(var key in options){
			if(typeof options[key] === 'object'){
				var temp = "";
				for(var index in options[key]){
					temp += options[key][index] + " ";
				}
				options[key] = temp;
			}
			$obj.attr(key,options[key])
		}
	}

	var HtmlModeler = {
		footer_arrow_left:function(options){
			var html = '<span class="arrow-left"><a alt="back"><img src="images/footer/arrow-left.png"></a></span>';
			var $obj = $(html);
			if(typeof options === 'object'){
				add_option($obj,options);
			}
			return $obj;
		},
		button:function(options){
			var $obj = $('<input type="button" role="button"/>');
			if(!options.value){
				console.log('没有配置value值，按钮创建失败');
				return ;
			}
			add_option($obj,options);
			return $obj;
		}
	}

	return HtmlModeler;
})